package com.user.controller;

import com.common.domain.dto.DoctorDto;
import com.common.domain.entity.Problem;
import com.common.domain.entity.ResponseResult;
import com.common.service.ProblemService;
import com.common.util.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author
 * @Date 2023/11/7 23:11
 **/
@RestController
public class ProblemController {
    @Autowired
    private ProblemService problemService;

    @PostMapping("/submitProblem")
    public ResponseResult submitProblem(@RequestBody Problem problem){
        return problemService.submitProblem(problem);
    }

    @GetMapping("allProblemList")
    public ResponseResult allProblemList(Integer pageNum, Integer pageSize){
        return problemService.allProblemList( pageNum,  pageSize, null ,null, SecurityUtils.getUserId());
    }

}
